<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>恢复配置选项的值</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.ini-parse-quantity.html">« ini_parse_quantity</a></li>
      <li style="float: right;"><a href="function.ini-set.html">ini_set »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.info.html">PHP 选项/信息 函数</a></li>
    <li>恢复配置选项的值</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.ini-restore" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ini_restore</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">ini_restore</span> &mdash; <span class="dc-title">恢复配置选项的值</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.ini-restore-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>ini_restore</strong></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$option</code></span>): <span class="type"><span class="type void">void</span></span></div>

  <p class="para rdfs-comment">
   恢复指定的配置选项到它的原始值。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.ini-restore-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">option</code></dt>

     <dd>

      <p class="para">
       配置选项名称。
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ini-restore-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   没有返回值。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.ini-restore-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-577">
    <p><strong>示例 #1 <span class="function"><strong>ini_restore()</strong></span> 例子</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$setting&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'html_errors'</span><span style="color: #007700">;<br /><br />echo&nbsp;</span><span style="color: #DD0000">'Current&nbsp;value&nbsp;for&nbsp;\''&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$setting&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">'\':&nbsp;'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">ini_get</span><span style="color: #007700">(</span><span style="color: #0000BB">$setting</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">ini_set</span><span style="color: #007700">(</span><span style="color: #0000BB">$setting</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">ini_get</span><span style="color: #007700">(</span><span style="color: #0000BB">$setting</span><span style="color: #007700">)&nbsp;?&nbsp;</span><span style="color: #0000BB">0&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #DD0000">'New&nbsp;value&nbsp;for&nbsp;\''&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$setting&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">'\':&nbsp;'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">ini_get</span><span style="color: #007700">(</span><span style="color: #0000BB">$setting</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">ini_restore</span><span style="color: #007700">(</span><span style="color: #0000BB">$setting</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #DD0000">'Original&nbsp;value&nbsp;for&nbsp;\''&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$setting&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">'\':&nbsp;'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">ini_get</span><span style="color: #007700">(</span><span style="color: #0000BB">$setting</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Current value for &#039;html_errors&#039;: 1
New value for &#039;html_errors&#039;: 0
Original value for &#039;html_errors&#039;: 1
</pre></div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.ini-restore-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.ini-get.html" class="function" rel="rdfs-seeAlso">ini_get()</a> - 获取一个配置选项的值</span></li>
    <li class="member"><span class="function"><a href="function.ini-get-all.html" class="function" rel="rdfs-seeAlso">ini_get_all()</a> - 获取所有配置选项</span></li>
    <li class="member"><span class="function"><a href="function.ini-set.html" class="function" rel="rdfs-seeAlso">ini_set()</a> - 为一个配置选项设置值</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>